from ctypes import byref
class CallbackPtrWrapper(object):
    def __init__(self, cbs, ptr=None):
        self.__cbs = cbs
        self.__ptr = ptr

    def ptr(self):
        return self.__ptr

    def set_ptr(self, ptr):
        self.__ptr = ptr
        return self

    def cbs_byref(self):
        return byref(self.__cbs) if self.__cbs is not None else None



